package com.foreknow.demo12;

public abstract class Pet {
    private int health;
    private int love;
    private String name;

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
    //定义了一个抽象方法：只有方法的声明，没有实现，抽象方法需要子类来实行
    public abstract void toHospital();
}
